package com.qinggeng.project.system.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.qinggeng.framework.aspectj.lang.annotation.Excel;
import lombok.Data;
import com.qinggeng.framework.web.domain.BaseEntity;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 求职用户对象 resume_user
 *
 * @author smallfish
 * @date 2020-12-23
 */
@Data
public class JobUser
{
    private static final long serialVersionUID = 1L;

    /** id */
    @ApiModelProperty(hidden = true)
    private Long jobUserId;

    /** 用户ID */
    @Excel(name = "用户ID")
    @ApiModelProperty(hidden = true)
    @JsonIgnore
    private Long userId;

    /** 用户头像 */
    @Excel(name = "用户头像")
    @ApiModelProperty(value = "用户头像",required = true)
    private String avatar;

    /** 真实姓名 */
    @Excel(name = "真实姓名")
    @ApiModelProperty(value = "真实姓名",required = true)
    private String userName;

    /** 出生日期 */
    @Excel(name = "出生日期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "出生日期",required = true)
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date birthday;

    /** 手机号码 */
    @Excel(name = "手机号码")
    @ApiModelProperty(value = "手机号码",required = true)
    private String phone;

    /** 性别（1=男2=女） */
    @Excel(name = "性别", readConverterExp = "0=男,1=女,2=未知")
    @ApiModelProperty(value = "性别（0=男,1=女,2=未知）",required = true)
    private String sex;

    @JsonIgnore
    @ApiModelProperty(hidden = true)
    private Date updateTime;

    private Long companyId;

    public JobUser() {
    }

    public JobUser(SysUser user) {
        this.avatar= user.getAvatar();
        this.userName=user.getNickName();
        this.phone=user.getPhonenumber();
        this.sex=user.getSex();
    }



    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("jobUserId", getJobUserId())
            .append("userId", getUserId())
            .append("avatar", getAvatar())
            .append("userName", getUserName())
            .append("birthday", getBirthday())
            .append("phone", getPhone())
            .append("sex", getSex())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
